Skip to content

Fix numeric array attribute parsing in declarative config - #9099

Open
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/declarative-config-numeric-array-attributes
Open

thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/declarative-config-numeric-array-attributes

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #9098

Description

  • The YAML parser returns Integer, Long or Double per list element, but AttributeListFactory required all int_array / double_array elements to share one boxed class, so [1, 2] (double_array) or [1, 5000000000] (int_array) failed SDK creation.
  • double_array now accepts any list of Number and converts each with doubleValue(), matching the scalar double case.
  • int_array now accepts any mix of Integer and Long and converts to long, matching the scalar int case; decimal elements are still rejected.
  • The configuration schema (v1.2.0, resource.yaml) defines numeric array items as type: number.
  • Related: Ignore resource attributes with null value in declarative config #8889 (null attribute value handling in the same factory).

Testing done

  • Added AttributeListFactoryTest#create_NumericArraysWithMixedElementTypes (double_array [1, 2] and [0.5, 1], int_array [1, 3000000000L]).
  • Added rejection cases to AttributeListFactoryTest#create_InvalidAttributes: int_array [1, 2.5] and double_array ["a"].
  • With the main-code change reverted, the new success test fails with value did not match type DOUBLE_ARRAY.
  • ./gradlew :sdk-extensions:declarative-config:check passed (575 tests).

@thswlsqls
thswlsqls marked this pull request as ready for review December 5, 2026 11:10
@thswlsqls
thswlsqls requested a review from a team as a code owner December 5, 2026 11:10
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-12-05 11:39 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with the author? Comment /dashboard route:author to route it back.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Dec 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.51%. Comparing base (ddaf381) to head (d904121).

Files with missing lines Patch % Lines
...figure/declarativeconfig/AttributeListFactory.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9099      +/-   ##
============================================
+ Coverage     90.50%   90.51%   +0.01%     
  Complexity    11273    11273              
============================================
  Files          1040     1040              
  Lines         30762    30755       -7     
  Branches       4035     4033       -2     
============================================
- Hits          27840    27837       -3     
+ Misses         1938     1934       -4     
  Partials        984      984              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Declarative config rejects numeric array attributes with integer or mixed-size elements

1 participant